package cn.drenal.capcap.entity;

import cn.drenal.capcap.entity.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tangzc.autotable.annotation.ColumnComment;
import com.tangzc.autotable.annotation.ColumnDefault;
import com.tangzc.autotable.annotation.ColumnNotNull;
import com.tangzc.mpe.autotable.annotation.*;
import com.tangzc.mpe.processer.annotation.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 活动预告表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper
@Table(comment = "活动预告表")
public class UpcomingActivity extends BaseEntity {
    @ColumnComment("主键")
    @ColumnId(mode = IdType.AUTO)
    private Long id;

    @ColumnComment("活动ID")
    @ColumnNotNull
    private Long activityId;

    @ColumnComment("标题")
    @ColumnNotNull
    private String title;

    @ColumnComment("描述")
    @Column(length = 500)
    private String description;

    @ColumnComment("图片")
    private String imageUrl;

    @ColumnComment("排序")
    @ColumnNotNull
    @ColumnDefault("0")
    private Integer sort;

    @ColumnComment("预告开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @ColumnComment("预告结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;
}